from urllib.robotparser import RobotFileParser

rp = RobotFileParser()
rp.set_url('https://www.baidu.com/')
rp.read()
print(rp.can_fetch('*', 'https://www.baidu.com/s?ie=utf-8&f=3&rsv_bp=1&rsv_idx=1&tn=baidu&wd=javascript&fenlei=256&oq=momo&rsv_pq=d5092e810011b54d&rsv_t=f1666sFVWdJ%2BEi%2Fw4PDGqXDhRuWDu69PlXbx%2FCkzV7%2FW12zRb9MWFvAwGSY&rqlang=cn&rsv_dl=th_0&rsv_enter=0&rsv_btype=t&rsv_sug3=54&rsv_sug1=47&rsv_sug7=101&rsv_sug2=0&rsp=0&rsv_sug9=es_0_1&inputT=5272&rsv_sug4=5834&rsv_sug=9'))
print(rp.can_fetch('*', 'https://www.baidu.com/s?ie=utf-8&f=3&rsv_bp=1&rsv_idx=1&tn=baidu&wd=javascript&fenlei=256&oq=javascript&rsv_pq=a08af4f40014ce90&rsv_t=2028WerwKvCbfwXSl2%2BXDsodOKOW4PCSS%2B8PnrVxVRtTfu3Qu8bT%2FEtqhdw&rqlang=cn&rsv_dl=ts_0&rsv_enter=0&rsv_btype=t&prefixsug=javascript&rsp=0&rsv_sug9=es_0_1&rsv_sug=9'))